[IA64] Remove is_vti arch flag
authorAlex Williamson <alex.williamson@hp.com>
Fri, 14 Dec 2007 19:53:03 +0000 (12:53 -0700)
committerAlex Williamson <alex.williamson@hp.com>
Fri, 14 Dec 2007 19:53:03 +0000 (12:53 -0700)
arch.is_vti is a duplicate of is_hvm.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
tools/libxc/ia64/xc_ia64_hvm_build.c
xen/arch/ia64/linux-xen/unwind.c
xen/arch/ia64/xen/dom0_ops.c
xen/arch/ia64/xen/domain.c
xen/arch/ia64/xen/vhpt.c
xen/include/asm-ia64/domain.h

index 3a9c0e16ba8f30c0934db654ffc0020e34c84cd1..1082c1b209cd772f34db5a3d637ed5f4140d0cf8 100644 (file)
@@ -980,7 +980,7 @@ setup_guest(int xc_handle, uint32_t dom, unsigned long memsize,
         goto error_out;
     }
 
-    domctl.u.arch_setup.flags = XEN_DOMAINSETUP_hvm_guest;
+    domctl.u.arch_setup.flags = 0;
     domctl.u.arch_setup.bp = 0;
     domctl.u.arch_setup.maxmem = GFW_START + GFW_SIZE;
     if (dom_memsize > MMIO_START)
index 58052b851c2d678f83f660bc0971699cbdbfd01f..ed72425ef3918358a2e4b810c07bf11efdf7b527 100644 (file)
@@ -2012,7 +2012,7 @@ unw_unwind_to_user (struct unw_frame_info *info)
                        return 0;
 #else
                if (unw_is_intr_frame(info) &&
-                   !info->task->domain->arch.is_vti &&
+                   !is_hvm_vcpu(info->task) &&
                    (pr & (1UL << PRED_USER_STACK)))
                        return 0;
                /*
@@ -2021,7 +2021,7 @@ unw_unwind_to_user (struct unw_frame_info *info)
                 * we need to stop unwinding somehow.
                 */
                if (unw_is_intr_frame(info) &&
-                   info->task->domain->arch.is_vti &&
+                   is_hvm_vcpu(info->task) &&
                    info->pr_loc == &vcpu_regs(info->task)->pr)
                        return 0;
 #endif
index 4c97d0e294fd1cca1b210cd06d9b1bd7d4cad4a7..87cf572807ede2d2ae45ebe30c60f2a35da2776e 100644 (file)
@@ -89,7 +89,7 @@ long arch_do_domctl(xen_domctl_t *op, XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
 
         if (ds->flags & XEN_DOMAINSETUP_query) {
             /* Set flags.  */
-            if (d->arch.is_vti)
+            if (is_hvm_domain(d))
                 ds->flags |= XEN_DOMAINSETUP_hvm_guest;
             /* Set params.  */
             ds->bp = 0;                /* unknown.  */
@@ -104,12 +104,12 @@ long arch_do_domctl(xen_domctl_t *op, XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
                 ret = -EFAULT;
         }
         else {
-            if (ds->flags & XEN_DOMAINSETUP_hvm_guest) {
+            if (is_hvm_domain(d) || (ds->flags & XEN_DOMAINSETUP_hvm_guest)) {
                 if (!vmx_enabled) {
                     printk("No VMX hardware feature for vmx domain.\n");
                     ret = -EINVAL;
                 } else {
-                    d->arch.is_vti = 1;
+                    d->is_hvm = 1;
                     xen_ia64_set_convmem_end(d, ds->maxmem);
                     ret = vmx_setup_platform(d);
                 }
index c0a94e5df8990fcb386f0a90d2e2dac4dc471f3b..faf945cdb6994aa6bea8906e1f3481d57e97ebbe 100644 (file)
@@ -516,7 +516,7 @@ int vcpu_late_initialise(struct vcpu *v)
 
 void vcpu_destroy(struct vcpu *v)
 {
-       if (v->domain->arch.is_vti)
+       if (is_hvm_vcpu(v))
                vmx_relinquish_vcpu_resources(v);
        else
                relinquish_vcpu_resources(v);
@@ -988,12 +988,12 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
        c.nat->event_callback_ip = v->arch.event_callback_ip;
 
        /* If PV and privregs is not set, we can't read mapped registers.  */
-       if (!v->domain->arch.is_vti && v->arch.privregs == NULL)
+       if (!is_hvm_vcpu(v) && v->arch.privregs == NULL)
                return;
 
        vcpu_get_dcr(v, &c.nat->regs.cr.dcr);
 
-       c.nat->regs.cr.itm = v->domain->arch.is_vti ?
+       c.nat->regs.cr.itm = is_hvm_vcpu(v) ?
                vmx_vcpu_get_itm(v) : PSCBX(v, domain_itm);
        vcpu_get_iva(v, &c.nat->regs.cr.iva);
        vcpu_get_pta(v, &c.nat->regs.cr.pta);
@@ -1006,7 +1006,7 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
        vcpu_get_iha(v, &c.nat->regs.cr.iha);
 
        //XXX change irr[] and arch.insvc[]
-       if (v->domain->arch.is_vti)
+       if (is_hvm_vcpu(v))
                /* c.nat->regs.cr.ivr = vmx_vcpu_get_ivr(v)*/;//XXXnot SMP-safe
        else
                vcpu_get_ivr (v, &c.nat->regs.cr.ivr);
@@ -1184,7 +1184,7 @@ int arch_set_info_guest(struct vcpu *v, vcpu_guest_context_u c)
 
        /* Finish vcpu initialization.  */
        if (!was_initialised) {
-               if (d->arch.is_vti)
+               if (is_hvm_domain(d))
                        rc = vmx_final_setup_guest(v);
                else
                        rc = vcpu_late_initialise(v);
@@ -1233,7 +1233,7 @@ int arch_set_info_guest(struct vcpu *v, vcpu_guest_context_u c)
        uregs->r10 = c.nat->regs.r[10];
        uregs->r11 = c.nat->regs.r[11];
 
-       if (!d->arch.is_vti)
+       if (!is_hvm_domain(d))
                vcpu_set_psr(v, c.nat->regs.psr);
        else
                vmx_vcpu_set_psr(v, c.nat->regs.psr);
@@ -1472,7 +1472,7 @@ int arch_set_info_guest(struct vcpu *v, vcpu_guest_context_u c)
                           !!(c.nat->regs.nats & (1UL << 7)));
        }
        
-       if (!d->arch.is_vti) {
+       if (!is_hvm_domain(d)) {
                /* domain runs at PL2/3 */
                uregs->cr_ipsr = vcpu_pl_adjust(uregs->cr_ipsr,
                                                IA64_PSR_CPL0_BIT);
@@ -1480,7 +1480,7 @@ int arch_set_info_guest(struct vcpu *v, vcpu_guest_context_u c)
        }
 
        for (i = 0; i < IA64_NUM_DBG_REGS; i++) {
-               if (d->arch.is_vti) {
+               if (is_hvm_domain(d)) {
                        vmx_vcpu_set_dbr(v, i, c.nat->regs.dbr[i]);
                        vmx_vcpu_set_ibr(v, i, c.nat->regs.ibr[i]);
                } else {
@@ -1497,7 +1497,7 @@ int arch_set_info_guest(struct vcpu *v, vcpu_guest_context_u c)
 
                if (rrval == 0)
                        continue;
-               if (d->arch.is_vti) {
+               if (is_hvm_domain(d)) {
                        //without VGCF_EXTRA_REGS check,
                        //VTi domain doesn't boot.
                        if (c.nat->flags & VGCF_EXTRA_REGS)
@@ -1514,7 +1514,7 @@ int arch_set_info_guest(struct vcpu *v, vcpu_guest_context_u c)
                for (i = 0;
                     (i < sizeof(tr->itrs) / sizeof(tr->itrs[0])) && i < NITRS;
                     i++) {
-                       if (d->arch.is_vti)
+                       if (is_hvm_domain(d))
                                vmx_vcpu_itr_i(v, i, tr->itrs[i].pte,
                                               tr->itrs[i].itir,
                                               tr->itrs[i].vadr);
@@ -1527,7 +1527,7 @@ int arch_set_info_guest(struct vcpu *v, vcpu_guest_context_u c)
                for (i = 0;
                     (i < sizeof(tr->dtrs) / sizeof(tr->dtrs[0])) && i < NDTRS;
                     i++) {
-                       if (d->arch.is_vti)
+                       if (is_hvm_domain(d))
                                vmx_vcpu_itr_d(v, i, tr->dtrs[i].pte,
                                               tr->dtrs[i].itir,
                                               tr->dtrs[i].vadr);
@@ -1542,7 +1542,7 @@ int arch_set_info_guest(struct vcpu *v, vcpu_guest_context_u c)
                vcpu_set_iva(v, c.nat->regs.cr.iva);
        }
 
-       if (d->arch.is_vti)
+       if (is_hvm_domain(d))
                rc = vmx_arch_set_info_guest(v, c);
 
        return rc;
@@ -1628,7 +1628,7 @@ int domain_relinquish_resources(struct domain *d)
        switch (d->arch.relres) {
        case RELRES_not_started:
                /* Relinquish guest resources for VT-i domain. */
-               if (d->arch.is_vti)
+               if (is_hvm_domain(d))
                        vmx_relinquish_guest_resources(d);
                d->arch.relres = RELRES_mm_teardown;
                /*fallthrough*/
@@ -1664,7 +1664,7 @@ int domain_relinquish_resources(struct domain *d)
                BUG();
        }
 
-       if (d->arch.is_vti && d->arch.sal_data)
+       if (is_hvm_domain(d) && d->arch.sal_data)
                xfree(d->arch.sal_data);
 
        /* Free page used by xen oprofile buffer */
index 16d4d0140a832773f63dbe322d42b6acf72382f6..aee9a833be06165e56f3767b1acdca39a80415f9 100644 (file)
@@ -498,7 +498,7 @@ static void flush_tlb_vhpt_all (struct domain *d)
 void domain_flush_tlb_vhpt(struct domain *d)
 {
        /* Very heavy...  */
-       if (HAS_PERVCPU_VHPT(d) || d->arch.is_vti)
+       if (HAS_PERVCPU_VHPT(d) || is_hvm_domain(d))
                on_each_cpu((void (*)(void *))local_flush_tlb_all, NULL, 1, 1);
        else
                on_each_cpu((void (*)(void *))flush_tlb_vhpt_all, d, 1, 1);
index ec0616b0a6daad53daeaf28ff8710790c13db37d..ed7fddd090cb45a4de83626d05963c0b609a581c 100644 (file)
@@ -133,13 +133,12 @@ struct arch_domain {
     /* Flags.  */
     union {
         unsigned long flags;
-        struct {
-            unsigned int is_vti : 1;
 #ifdef CONFIG_XEN_IA64_PERVCPU_VHPT
+        struct {
             unsigned int has_pervcpu_vhpt : 1;
             unsigned int vhpt_size_log2 : 6;
-#endif
         };
+#endif
     };
 
     /* maximum metaphysical address of conventional memory */